﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chinaer.Dao
{
    public class ProvinceDAO:Repository,IDao.IProvinceDAO
    {
        private IDao.IProvinceDAO provinceDAO = new Dao.EF.ProvinceDAO();
        public List<Model.Entities.Model_Province> GetProvincesByCountryID(string countryID)
        {
            return provinceDAO.GetProvincesByCountryID(countryID);
        }

        public bool EnableTrack
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public IList<Model.Entities.Model_Province> Query(string sql, int pageIndex, out int recordCount, int pageSize, params System.Data.SqlClient.SqlParameter[] sqlParams)
        {
            return provinceDAO.Query(sql, pageIndex, out recordCount, pageSize, sqlParams);
        }

        public Model.Entities.Model_Province GetByID(string id)
        {
            return provinceDAO.GetByID(id);
        }

        public bool Exists(string id)
        {
            return provinceDAO.Exists(id);
        }

        public bool Add(Model.Entities.Model_Province entity)
        {
            return provinceDAO.Add(entity);
        }

        public bool Update(Model.Entities.Model_Province entity)
        {
            return provinceDAO.Update(entity);
        }

        public bool Delete(Model.Entities.Model_Province entity)
        {
            return provinceDAO.Delete(entity);
        }

        public bool Delete(string id)
        {
            return provinceDAO.Delete(id);
        }

        public int DeleteByIDs(IList<string> listID)
        {
            return provinceDAO.DeleteByIDs(listID);
        }


        public Model.Entities.Model_Province GetByName(string provinceName)
        {
            return provinceDAO.GetByName(provinceName);
        }

        public Model.Entities.Model_Province GetByCode(string provinceCode)
        {
            return provinceDAO.GetByCode(provinceCode);
        }
    }
}
